From f18239411ba4d145f4cc04239b3177fc4382a41a Mon Sep 17 00:00:00 2001 From: "mafetter@fleming.research" Date: Sat, 5 Feb 2005 10:50:49 +0000 Subject: [PATCH] bitkeeper revision 1.1159.223.68 (4204a5090n9Cd2ll6YcdL3tK2uDu1A) Bug fix to the scheduler for writable page tables. Don't flush the writable page tables inside __enter_scheduler() until after we've committed to switching to another domain. Here's the problem: if enough debugging messages are enabled (for example, shadow mode and/or writable page tables messages), then we can get into a situation where we *always* visit __enter_scheduler() after every page fault and/or hypercall. If we flush the writable page tables every time we take a page fault, we'll never end up actually getting into the domain with write permissions enabled to its page table. Signed-off-by: michael.fetterman@cl.cam.ac.uk --- xen/common/schedule.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/common/schedule.c b/xen/common/schedule.c index 5be947dc5a..ec215d5ed9 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -318,8 +318,6 @@ void __enter_scheduler(void) task_slice_t next_slice; s32 r_time; /* time for new dom to run */ - cleanup_writable_pagetable(prev); - perfc_incrc(sched_run); spin_lock_irq(&schedule_data[cpu].schedule_lock); @@ -369,6 +367,8 @@ void __enter_scheduler(void) perfc_incrc(sched_ctx); + cleanup_writable_pagetable(prev); + #if defined(WAKE_HISTO) if ( !is_idle_task(next) && next->wokenup ) { ulong diff = (ulong)(now - next->wokenup); -- 2.30.2